import com.stx.pojo.BMW;
import com.stx.pojo.Benz;
import com.stx.pojo.Driver;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mytest {

    @Test
    public void Test1(){
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("ApplicationContext.xml");
        Benz benz = context.getBean("Benz", Benz.class);
        BMW bmw = context.getBean("BMW", BMW.class);
        Driver driver = context.getBean("Driver", Driver.class);
        benz.run();
        bmw.run();
        driver.driver(benz);
    }
}
